#include "waityihui.h"
#include "ui_waityihui.h"
#include <QDebug>
#include <QSqlQuery>


waityihui::waityihui(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::waityihui)
{
    ui->setupUi(this);
    ui->name->setFocusPolicy(Qt::NoFocus);
    ui->id->setFocusPolicy(Qt::NoFocus);

}

void waityihui::recvData(QString name,QString id){

    ui->name->setText(name);
    ui->id->setText(id);


}




waityihui::~waityihui()
{
    delete ui;
}

void waityihui::on_pushButton_clicked()
{

    this->close();

}

void waityihui::on_pushButton_2_clicked()//删除原来的数据(更新)
{
    QSqlQuery query;
    QString id=ui->id->text();
    //qDebug()<<id;
    query.prepare(QString("delete from Ctest where IDNum='%1'").arg(id));
    query.exec();

    this->close();

}
